package com.wr.springbootRabbitMqConsumer.service.topic;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;

@RabbitListener(bindings = @QueueBinding(
        value = @Queue(value = "duanxin.topic.queue",declare = "true"),
        exchange = @Exchange(value = "topic-order-exchange",type = ExchangeTypes.TOPIC),
        key = "#.duanxin.#"
))
@Component
public class TopicDuanXinConsumer {

    @RabbitHandler
    public void consumer(String message){
        System.out.println("duanxin---》接收到消息："+message);
    }
}
